@use "sass:map";
$obj: (
  light: (
    bgColor: #fff,
    textColor: #000,
  ),
  dark: (
    bgColor: #000,
    textColor: #fff,
  ),
);

$currentTheme:light;

@mixin usetheme() {
  @each $key, $zks in $obj {
    $currentTheme:$key !global;
    -#{$key} & {
      @content;
    }
   
  }
}
@function getval($key) {
  @return map.get(map.get($obj, $currentTheme),$key);
}

.abc {
  @include usetheme {
    background: getval('bgColor');
    color: getval('textColor');;
  }
}
